<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-comment">-- | This module provides an interface for typechecker plugins to</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- access select functions of the 'TcM', principally those to do with</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- reading parts of the state.</span><span>
</span><span id="line-5"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Tc.Plugin</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-6"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Basic TcPluginM functionality</span></span><span>
</span><span id="line-7"></span><span>        </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier">TcPluginM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-8"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#tcPluginIO"><span class="hs-identifier">tcPluginIO</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-9"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#tcPluginTrace"><span class="hs-identifier">tcPluginTrace</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-10"></span><span>        </span><span class="annot"><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier">unsafeTcPluginTcM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Finding Modules and Names</span></span><span>
</span><span id="line-13"></span><span>        </span><span class="annot"><a href="GHC.Driver.Types.html#FindResult"><span class="hs-identifier">FindResult</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-14"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#findImportedModule"><span class="hs-identifier">findImportedModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#lookupOrig"><span class="hs-identifier">lookupOrig</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Looking up Names in the typechecking environment</span></span><span>
</span><span id="line-18"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#tcLookupGlobal"><span class="hs-identifier">tcLookupGlobal</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#tcLookupTyCon"><span class="hs-identifier">tcLookupTyCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#tcLookupDataCon"><span class="hs-identifier">tcLookupDataCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#tcLookupClass"><span class="hs-identifier">tcLookupClass</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#tcLookup"><span class="hs-identifier">tcLookup</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#tcLookupId"><span class="hs-identifier">tcLookupId</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Getting the TcM state</span></span><span>
</span><span id="line-26"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#getTopEnv"><span class="hs-identifier">getTopEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#getEnvs"><span class="hs-identifier">getEnvs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#getInstEnvs"><span class="hs-identifier">getInstEnvs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#getFamInstEnvs"><span class="hs-identifier">getFamInstEnvs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#matchFam"><span class="hs-identifier">matchFam</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Type variables</span></span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#newUnique"><span class="hs-identifier">newUnique</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#newFlexiTyVar"><span class="hs-identifier">newFlexiTyVar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#isTouchableTcPluginM"><span class="hs-identifier">isTouchableTcPluginM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Zonking</span></span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#zonkTcType"><span class="hs-identifier">zonkTcType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#zonkCt"><span class="hs-identifier">zonkCt</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Creating constraints</span></span><span>
</span><span id="line-42"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#newWanted"><span class="hs-identifier">newWanted</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#newDerived"><span class="hs-identifier">newDerived</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#newGiven"><span class="hs-identifier">newGiven</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-45"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#newCoercionHole"><span class="hs-identifier">newCoercionHole</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Manipulating evidence bindings</span></span><span>
</span><span id="line-48"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#newEvVar"><span class="hs-identifier">newEvVar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>        </span><span class="annot"><a href="GHC.Tc.Plugin.html#setEvBind"><span class="hs-identifier">setEvBind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>        </span><span class="annot"><a href="GHC.Tc.Types.html#getEvBindsTcPluginM"><span class="hs-identifier">getEvBindsTcPluginM</span></a></span><span>
</span><span id="line-51"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-52"></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>           </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">TcM</span></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Tc.Solver.Monad.html"><span class="hs-identifier">GHC.Tc.Solver.Monad</span></a></span><span>    </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">TcS</span></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html"><span class="hs-identifier">GHC.Tc.Utils.Env</span></a></span><span>             </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">TcM</span></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcMType.html"><span class="hs-identifier">GHC.Tc.Utils.TcMType</span></a></span><span>   </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">TcM</span></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Tc.Instance.Family.html"><span class="hs-identifier">GHC.Tc.Instance.Family</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">TcM</span></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html"><span class="hs-identifier">GHC.Iface.Env</span></a></span><span>          </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">IfaceEnv</span></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Driver.Finder.html"><span class="hs-identifier">GHC.Driver.Finder</span></a></span><span>      </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Finder</span></span><span>
</span><span id="line-62"></span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html"><span class="hs-identifier">GHC.Core.FamInstEnv</span></a></span><span>     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInstEnv"><span class="hs-identifier">FamInstEnv</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>      </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcGblEnv"><span class="hs-identifier">TcGblEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcLclEnv"><span class="hs-identifier">TcLclEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier">TcPluginM</span></a></span><span>
</span><span id="line-65"></span><span>                               </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier">unsafeTcPluginTcM</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#getEvBindsTcPluginM"><span class="hs-identifier">getEvBindsTcPluginM</span></a></span><span>
</span><span id="line-66"></span><span>                               </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier">liftIO</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier">traceTc</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html"><span class="hs-identifier">GHC.Tc.Types.Constraint</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#Ct"><span class="hs-identifier">Ct</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#CtLoc"><span class="hs-identifier">CtLoc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#CtEvidence"><span class="hs-identifier">CtEvidence</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#ctLocOrigin"><span class="hs-identifier">ctLocOrigin</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcMType.html"><span class="hs-identifier">GHC.Tc.Utils.TcMType</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TcTyVar"><span class="hs-identifier">TcTyVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier">TcType</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html"><span class="hs-identifier">GHC.Tc.Utils.Env</span></a></span><span>        </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcTyThing"><span class="hs-identifier">TcTyThing</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html"><span class="hs-identifier">GHC.Tc.Types.Evidence</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#TcCoercion"><span class="hs-identifier">TcCoercion</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CoercionHole"><span class="hs-identifier">CoercionHole</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTerm"><span class="hs-identifier">EvTerm</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-71"></span><span>                               </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvExpr"><span class="hs-identifier">EvExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvBind"><span class="hs-identifier">EvBind</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#mkGivenEvBind"><span class="hs-identifier">mkGivenEvBind</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span>           </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier">EvVar</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-75"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>
</span><span id="line-77"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>
</span><span id="line-78"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Class.html"><span class="hs-identifier">GHC.Core.Class</span></a></span><span>
</span><span id="line-79"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-80"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-81"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-82"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.html"><span class="hs-identifier">GHC.Core.Coercion</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#BlockSubstFlag"><span class="hs-identifier">BlockSubstFlag</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-83"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-84"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.InstEnv.html"><span class="hs-identifier">GHC.Core.InstEnv</span></a></span><span>
</span><span id="line-85"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-86"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html"><span class="hs-identifier">GHC.Types.Unique</span></a></span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span class="hs-comment">-- | Perform some IO, typically to interact with an external tool.</span><span>
</span><span id="line-90"></span><span id="local-6989586621681198848"><span class="annot"><a href="GHC.Tc.Plugin.html#tcPluginIO"><span class="hs-identifier hs-type">tcPluginIO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681198848"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681198848"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-91"></span><span id="tcPluginIO"><span class="annot"><span class="annottext">tcPluginIO :: forall a. IO a -&gt; TcPluginM a
</span><a href="GHC.Tc.Plugin.html#tcPluginIO"><span class="hs-identifier hs-var hs-var">tcPluginIO</span></a></span></span><span> </span><span id="local-6989586621681198742"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621681198742"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM a -&gt; TcPluginM a
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IO a -&gt; TcM a
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621681198742"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-92"></span><span>
</span><span id="line-93"></span><span class="hs-comment">-- | Output useful for debugging the compiler.</span><span>
</span><span id="line-94"></span><span class="annot"><a href="GHC.Tc.Plugin.html#tcPluginTrace"><span class="hs-identifier hs-type">tcPluginTrace</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-95"></span><span id="tcPluginTrace"><span class="annot"><span class="annottext">tcPluginTrace :: String -&gt; SDoc -&gt; TcPluginM ()
</span><a href="GHC.Tc.Plugin.html#tcPluginTrace"><span class="hs-identifier hs-var hs-var">tcPluginTrace</span></a></span></span><span> </span><span id="local-6989586621681198741"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681198741"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621681198740"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681198740"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM () -&gt; TcPluginM ()
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcM ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681198741"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681198740"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span>
</span><span id="line-98"></span><span class="annot"><a href="GHC.Tc.Plugin.html#findImportedModule"><span class="hs-identifier hs-type">findImportedModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FindResult"><span class="hs-identifier hs-type">FindResult</span></a></span><span>
</span><span id="line-99"></span><span id="findImportedModule"><span class="annot"><span class="annottext">findImportedModule :: ModuleName -&gt; Maybe FastString -&gt; TcPluginM FindResult
</span><a href="GHC.Tc.Plugin.html#findImportedModule"><span class="hs-identifier hs-var hs-var">findImportedModule</span></a></span></span><span> </span><span id="local-6989586621681198739"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681198739"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span id="local-6989586621681198738"><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681198738"><span class="hs-identifier hs-var">mb_pkg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-100"></span><span>    </span><span id="local-6989586621681198737"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198737"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcPluginM HscEnv
</span><a href="GHC.Tc.Plugin.html#getTopEnv"><span class="hs-identifier hs-var">getTopEnv</span></a></span><span>
</span><span id="line-101"></span><span>    </span><span class="annot"><span class="annottext">IO FindResult -&gt; TcPluginM FindResult
forall a. IO a -&gt; TcPluginM a
</span><a href="GHC.Tc.Plugin.html#tcPluginIO"><span class="hs-identifier hs-var">tcPluginIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO FindResult -&gt; TcPluginM FindResult)
-&gt; IO FindResult -&gt; TcPluginM FindResult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleName -&gt; Maybe FastString -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findImportedModule"><span class="hs-identifier hs-var">Finder.findImportedModule</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681198737"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681198739"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681198738"><span class="hs-identifier hs-var">mb_pkg</span></a></span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span class="annot"><a href="GHC.Tc.Plugin.html#lookupOrig"><span class="hs-identifier hs-type">lookupOrig</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-104"></span><span id="lookupOrig"><span class="annot"><span class="annottext">lookupOrig :: Module -&gt; OccName -&gt; TcPluginM Name
</span><a href="GHC.Tc.Plugin.html#lookupOrig"><span class="hs-identifier hs-var hs-var">lookupOrig</span></a></span></span><span> </span><span id="local-6989586621681198735"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681198735"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM Name -&gt; TcPluginM Name
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM Name -&gt; TcPluginM Name)
-&gt; (OccName -&gt; TcM Name) -&gt; OccName -&gt; TcPluginM Name
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; OccName -&gt; TcM Name
forall a b. Module -&gt; OccName -&gt; TcRnIf a b Name
</span><a href="GHC.Iface.Env.html#lookupOrig"><span class="hs-identifier hs-var">IfaceEnv.lookupOrig</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681198735"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span>
</span><span id="line-107"></span><span class="annot"><a href="GHC.Tc.Plugin.html#tcLookupGlobal"><span class="hs-identifier hs-type">tcLookupGlobal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyThing"><span class="hs-identifier hs-type">TyThing</span></a></span><span>
</span><span id="line-108"></span><span id="tcLookupGlobal"><span class="annot"><span class="annottext">tcLookupGlobal :: Name -&gt; TcPluginM TyThing
</span><a href="GHC.Tc.Plugin.html#tcLookupGlobal"><span class="hs-identifier hs-var hs-var">tcLookupGlobal</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM TyThing -&gt; TcPluginM TyThing
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM TyThing -&gt; TcPluginM TyThing)
-&gt; (Name -&gt; TcM TyThing) -&gt; Name -&gt; TcPluginM TyThing
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM TyThing
</span><a href="GHC.Tc.Utils.Env.html#tcLookupGlobal"><span class="hs-identifier hs-var">TcM.tcLookupGlobal</span></a></span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span class="annot"><a href="GHC.Tc.Plugin.html#tcLookupTyCon"><span class="hs-identifier hs-type">tcLookupTyCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>
</span><span id="line-111"></span><span id="tcLookupTyCon"><span class="annot"><span class="annottext">tcLookupTyCon :: Name -&gt; TcPluginM TyCon
</span><a href="GHC.Tc.Plugin.html#tcLookupTyCon"><span class="hs-identifier hs-var hs-var">tcLookupTyCon</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM TyCon -&gt; TcPluginM TyCon
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM TyCon -&gt; TcPluginM TyCon)
-&gt; (Name -&gt; TcM TyCon) -&gt; Name -&gt; TcPluginM TyCon
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM TyCon
</span><a href="GHC.Tc.Utils.Env.html#tcLookupTyCon"><span class="hs-identifier hs-var">TcM.tcLookupTyCon</span></a></span><span>
</span><span id="line-112"></span><span>
</span><span id="line-113"></span><span class="annot"><a href="GHC.Tc.Plugin.html#tcLookupDataCon"><span class="hs-identifier hs-type">tcLookupDataCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>
</span><span id="line-114"></span><span id="tcLookupDataCon"><span class="annot"><span class="annottext">tcLookupDataCon :: Name -&gt; TcPluginM DataCon
</span><a href="GHC.Tc.Plugin.html#tcLookupDataCon"><span class="hs-identifier hs-var hs-var">tcLookupDataCon</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM DataCon -&gt; TcPluginM DataCon
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM DataCon -&gt; TcPluginM DataCon)
-&gt; (Name -&gt; TcM DataCon) -&gt; Name -&gt; TcPluginM DataCon
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM DataCon
</span><a href="GHC.Tc.Utils.Env.html#tcLookupDataCon"><span class="hs-identifier hs-var">TcM.tcLookupDataCon</span></a></span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span class="annot"><a href="GHC.Tc.Plugin.html#tcLookupClass"><span class="hs-identifier hs-type">tcLookupClass</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.Class.html#Class"><span class="hs-identifier hs-type">Class</span></a></span><span>
</span><span id="line-117"></span><span id="tcLookupClass"><span class="annot"><span class="annottext">tcLookupClass :: Name -&gt; TcPluginM Class
</span><a href="GHC.Tc.Plugin.html#tcLookupClass"><span class="hs-identifier hs-var hs-var">tcLookupClass</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM Class -&gt; TcPluginM Class
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM Class -&gt; TcPluginM Class)
-&gt; (Name -&gt; TcM Class) -&gt; Name -&gt; TcPluginM Class
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM Class
</span><a href="GHC.Tc.Utils.Env.html#tcLookupClass"><span class="hs-identifier hs-var">TcM.tcLookupClass</span></a></span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span class="annot"><a href="GHC.Tc.Plugin.html#tcLookup"><span class="hs-identifier hs-type">tcLookup</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcTyThing"><span class="hs-identifier hs-type">TcTyThing</span></a></span><span>
</span><span id="line-120"></span><span id="tcLookup"><span class="annot"><span class="annottext">tcLookup :: Name -&gt; TcPluginM TcTyThing
</span><a href="GHC.Tc.Plugin.html#tcLookup"><span class="hs-identifier hs-var hs-var">tcLookup</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM TcTyThing -&gt; TcPluginM TcTyThing
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM TcTyThing -&gt; TcPluginM TcTyThing)
-&gt; (Name -&gt; TcM TcTyThing) -&gt; Name -&gt; TcPluginM TcTyThing
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM TcTyThing
</span><a href="GHC.Tc.Utils.Env.html#tcLookup"><span class="hs-identifier hs-var">TcM.tcLookup</span></a></span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span class="annot"><a href="GHC.Tc.Plugin.html#tcLookupId"><span class="hs-identifier hs-type">tcLookupId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-123"></span><span id="tcLookupId"><span class="annot"><span class="annottext">tcLookupId :: Name -&gt; TcPluginM Id
</span><a href="GHC.Tc.Plugin.html#tcLookupId"><span class="hs-identifier hs-var hs-var">tcLookupId</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM Id -&gt; TcPluginM Id
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM Id -&gt; TcPluginM Id)
-&gt; (Name -&gt; TcM Id) -&gt; Name -&gt; TcPluginM Id
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM Id
</span><a href="GHC.Tc.Utils.Env.html#tcLookupId"><span class="hs-identifier hs-var">TcM.tcLookupId</span></a></span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span>
</span><span id="line-126"></span><span class="annot"><a href="GHC.Tc.Plugin.html#getTopEnv"><span class="hs-identifier hs-type">getTopEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span>
</span><span id="line-127"></span><span id="getTopEnv"><span class="annot"><span class="annottext">getTopEnv :: TcPluginM HscEnv
</span><a href="GHC.Tc.Plugin.html#getTopEnv"><span class="hs-identifier hs-var hs-var">getTopEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM HscEnv -&gt; TcPluginM HscEnv
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">TcM HscEnv
forall gbl lcl. TcRnIf gbl lcl HscEnv
</span><a href="GHC.Tc.Utils.Monad.html#getTopEnv"><span class="hs-identifier hs-var">TcM.getTopEnv</span></a></span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span class="annot"><a href="GHC.Tc.Plugin.html#getEnvs"><span class="hs-identifier hs-type">getEnvs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.html#TcGblEnv"><span class="hs-identifier hs-type">TcGblEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcLclEnv"><span class="hs-identifier hs-type">TcLclEnv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-130"></span><span id="getEnvs"><span class="annot"><span class="annottext">getEnvs :: TcPluginM (TcGblEnv, TcLclEnv)
</span><a href="GHC.Tc.Plugin.html#getEnvs"><span class="hs-identifier hs-var hs-var">getEnvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM (TcGblEnv, TcLclEnv) -&gt; TcPluginM (TcGblEnv, TcLclEnv)
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">TcM (TcGblEnv, TcLclEnv)
forall gbl lcl. TcRnIf gbl lcl (gbl, lcl)
</span><a href="GHC.Tc.Utils.Monad.html#getEnvs"><span class="hs-identifier hs-var">TcM.getEnvs</span></a></span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span class="annot"><a href="GHC.Tc.Plugin.html#getInstEnvs"><span class="hs-identifier hs-type">getInstEnvs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.InstEnv.html#InstEnvs"><span class="hs-identifier hs-type">InstEnvs</span></a></span><span>
</span><span id="line-133"></span><span id="getInstEnvs"><span class="annot"><span class="annottext">getInstEnvs :: TcPluginM InstEnvs
</span><a href="GHC.Tc.Plugin.html#getInstEnvs"><span class="hs-identifier hs-var hs-var">getInstEnvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM InstEnvs -&gt; TcPluginM InstEnvs
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">TcM InstEnvs
</span><a href="GHC.Tc.Utils.Env.html#tcGetInstEnvs"><span class="hs-identifier hs-var">TcM.tcGetInstEnvs</span></a></span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span class="annot"><a href="GHC.Tc.Plugin.html#getFamInstEnvs"><span class="hs-identifier hs-type">getFamInstEnvs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInstEnv"><span class="hs-identifier hs-type">FamInstEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInstEnv"><span class="hs-identifier hs-type">FamInstEnv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-136"></span><span id="getFamInstEnvs"><span class="annot"><span class="annottext">getFamInstEnvs :: TcPluginM (FamInstEnv, FamInstEnv)
</span><a href="GHC.Tc.Plugin.html#getFamInstEnvs"><span class="hs-identifier hs-var hs-var">getFamInstEnvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM (FamInstEnv, FamInstEnv) -&gt; TcPluginM (FamInstEnv, FamInstEnv)
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">TcM (FamInstEnv, FamInstEnv)
</span><a href="GHC.Tc.Instance.Family.html#tcGetFamInstEnvs"><span class="hs-identifier hs-var">TcM.tcGetFamInstEnvs</span></a></span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span class="annot"><a href="GHC.Tc.Plugin.html#matchFam"><span class="hs-identifier hs-type">matchFam</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-139"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#TcCoercion"><span class="hs-identifier hs-type">TcCoercion</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-140"></span><span id="matchFam"><span class="annot"><span class="annottext">matchFam :: TyCon -&gt; [Type] -&gt; TcPluginM (Maybe (TcCoercion, Type))
</span><a href="GHC.Tc.Plugin.html#matchFam"><span class="hs-identifier hs-var hs-var">matchFam</span></a></span></span><span> </span><span id="local-6989586621681198722"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681198722"><span class="hs-identifier hs-var">tycon</span></a></span></span><span> </span><span id="local-6989586621681198721"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681198721"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM (Maybe (TcCoercion, Type))
-&gt; TcPluginM (Maybe (TcCoercion, Type))
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (Maybe (TcCoercion, Type))
 -&gt; TcPluginM (Maybe (TcCoercion, Type)))
-&gt; TcM (Maybe (TcCoercion, Type))
-&gt; TcPluginM (Maybe (TcCoercion, Type))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [Type] -&gt; TcM (Maybe (TcCoercion, Type))
</span><a href="GHC.Tc.Solver.Monad.html#matchFamTcM"><span class="hs-identifier hs-var">TcS.matchFamTcM</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681198722"><span class="hs-identifier hs-var">tycon</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681198721"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span class="annot"><a href="GHC.Tc.Plugin.html#newUnique"><span class="hs-identifier hs-type">newUnique</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span>
</span><span id="line-143"></span><span id="newUnique"><span class="annot"><span class="annottext">newUnique :: TcPluginM Unique
</span><a href="GHC.Tc.Plugin.html#newUnique"><span class="hs-identifier hs-var hs-var">newUnique</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM Unique -&gt; TcPluginM Unique
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">TcM Unique
forall gbl lcl. TcRnIf gbl lcl Unique
</span><a href="GHC.Tc.Utils.Monad.html#newUnique"><span class="hs-identifier hs-var">TcM.newUnique</span></a></span><span>
</span><span id="line-144"></span><span>
</span><span id="line-145"></span><span class="annot"><a href="GHC.Tc.Plugin.html#newFlexiTyVar"><span class="hs-identifier hs-type">newFlexiTyVar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TcTyVar"><span class="hs-identifier hs-type">TcTyVar</span></a></span><span>
</span><span id="line-146"></span><span id="newFlexiTyVar"><span class="annot"><span class="annottext">newFlexiTyVar :: Type -&gt; TcPluginM Id
</span><a href="GHC.Tc.Plugin.html#newFlexiTyVar"><span class="hs-identifier hs-var hs-var">newFlexiTyVar</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM Id -&gt; TcPluginM Id
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM Id -&gt; TcPluginM Id)
-&gt; (Type -&gt; TcM Id) -&gt; Type -&gt; TcPluginM Id
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; TcM Id
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVar"><span class="hs-identifier hs-var">TcM.newFlexiTyVar</span></a></span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span class="annot"><a href="GHC.Tc.Plugin.html#isTouchableTcPluginM"><span class="hs-identifier hs-type">isTouchableTcPluginM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TcTyVar"><span class="hs-identifier hs-type">TcTyVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-149"></span><span id="isTouchableTcPluginM"><span class="annot"><span class="annottext">isTouchableTcPluginM :: Id -&gt; TcPluginM Bool
</span><a href="GHC.Tc.Plugin.html#isTouchableTcPluginM"><span class="hs-identifier hs-var hs-var">isTouchableTcPluginM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM Bool -&gt; TcPluginM Bool
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM Bool -&gt; TcPluginM Bool)
-&gt; (Id -&gt; TcM Bool) -&gt; Id -&gt; TcPluginM Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; TcM Bool
</span><a href="GHC.Tc.Utils.Monad.html#isTouchableTcM"><span class="hs-identifier hs-var">TcM.isTouchableTcM</span></a></span><span>
</span><span id="line-150"></span><span>
</span><span id="line-151"></span><span class="hs-comment">-- Confused by zonking? See Note [What is zonking?] in GHC.Tc.Utils.TcMType.</span><span>
</span><span id="line-152"></span><span class="annot"><a href="GHC.Tc.Plugin.html#zonkTcType"><span class="hs-identifier hs-type">zonkTcType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span>
</span><span id="line-153"></span><span id="zonkTcType"><span class="annot"><span class="annottext">zonkTcType :: Type -&gt; TcPluginM Type
</span><a href="GHC.Tc.Plugin.html#zonkTcType"><span class="hs-identifier hs-var hs-var">zonkTcType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM Type -&gt; TcPluginM Type
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM Type -&gt; TcPluginM Type)
-&gt; (Type -&gt; TcM Type) -&gt; Type -&gt; TcPluginM Type
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; TcM Type
</span><a href="GHC.Tc.Utils.TcMType.html#zonkTcType"><span class="hs-identifier hs-var">TcM.zonkTcType</span></a></span><span>
</span><span id="line-154"></span><span>
</span><span id="line-155"></span><span class="annot"><a href="GHC.Tc.Plugin.html#zonkCt"><span class="hs-identifier hs-type">zonkCt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#Ct"><span class="hs-identifier hs-type">Ct</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#Ct"><span class="hs-identifier hs-type">Ct</span></a></span><span>
</span><span id="line-156"></span><span id="zonkCt"><span class="annot"><span class="annottext">zonkCt :: Ct -&gt; TcPluginM Ct
</span><a href="GHC.Tc.Plugin.html#zonkCt"><span class="hs-identifier hs-var hs-var">zonkCt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM Ct -&gt; TcPluginM Ct
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM Ct -&gt; TcPluginM Ct) -&gt; (Ct -&gt; TcM Ct) -&gt; Ct -&gt; TcPluginM Ct
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Ct -&gt; TcM Ct
</span><a href="GHC.Tc.Utils.TcMType.html#zonkCt"><span class="hs-identifier hs-var">TcM.zonkCt</span></a></span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span class="hs-comment">-- | Create a new wanted constraint.</span><span>
</span><span id="line-160"></span><span class="annot"><a href="GHC.Tc.Plugin.html#newWanted"><span class="hs-identifier hs-type">newWanted</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#CtLoc"><span class="hs-identifier hs-type">CtLoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier hs-type">PredType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#CtEvidence"><span class="hs-identifier hs-type">CtEvidence</span></a></span><span>
</span><span id="line-161"></span><span id="newWanted"><span class="annot"><span class="annottext">newWanted :: CtLoc -&gt; Type -&gt; TcPluginM CtEvidence
</span><a href="GHC.Tc.Plugin.html#newWanted"><span class="hs-identifier hs-var hs-var">newWanted</span></a></span></span><span> </span><span id="local-6989586621681198712"><span class="annot"><span class="annottext">CtLoc
</span><a href="#local-6989586621681198712"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681198711"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681198711"><span class="hs-identifier hs-var">pty</span></a></span></span><span>
</span><span id="line-162"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM CtEvidence -&gt; TcPluginM CtEvidence
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CtOrigin -&gt; Maybe TypeOrKind -&gt; Type -&gt; TcM CtEvidence
</span><a href="GHC.Tc.Utils.TcMType.html#newWanted"><span class="hs-identifier hs-var">TcM.newWanted</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CtLoc -&gt; CtOrigin
</span><a href="GHC.Tc.Types.Constraint.html#ctLocOrigin"><span class="hs-identifier hs-var">ctLocOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">CtLoc
</span><a href="#local-6989586621681198712"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe TypeOrKind
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681198711"><span class="hs-identifier hs-var">pty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span class="hs-comment">-- | Create a new derived constraint.</span><span>
</span><span id="line-165"></span><span class="annot"><a href="GHC.Tc.Plugin.html#newDerived"><span class="hs-identifier hs-type">newDerived</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#CtLoc"><span class="hs-identifier hs-type">CtLoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier hs-type">PredType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#CtEvidence"><span class="hs-identifier hs-type">CtEvidence</span></a></span><span>
</span><span id="line-166"></span><span id="newDerived"><span class="annot"><span class="annottext">newDerived :: CtLoc -&gt; Type -&gt; TcPluginM CtEvidence
</span><a href="GHC.Tc.Plugin.html#newDerived"><span class="hs-identifier hs-var hs-var">newDerived</span></a></span></span><span> </span><span id="local-6989586621681198709"><span class="annot"><span class="annottext">CtLoc
</span><a href="#local-6989586621681198709"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681198708"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681198708"><span class="hs-identifier hs-var">pty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CtEvidence -&gt; TcPluginM CtEvidence
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CtDerived :: Type -&gt; CtLoc -&gt; CtEvidence
</span><a href="GHC.Tc.Types.Constraint.html#CtDerived"><span class="hs-identifier hs-type">CtDerived</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ctev_pred :: Type
</span><a href="GHC.Tc.Types.Constraint.html#ctev_pred"><span class="hs-identifier hs-var">ctev_pred</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681198708"><span class="hs-identifier hs-var">pty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ctev_loc :: CtLoc
</span><a href="GHC.Tc.Types.Constraint.html#ctev_loc"><span class="hs-identifier hs-var">ctev_loc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CtLoc
</span><a href="#local-6989586621681198709"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-167"></span><span>
</span><span id="line-168"></span><span class="hs-comment">-- | Create a new given constraint, with the supplied evidence.  This</span><span>
</span><span id="line-169"></span><span class="hs-comment">-- must not be invoked from 'tcPluginInit' or 'tcPluginStop', or it</span><span>
</span><span id="line-170"></span><span class="hs-comment">-- will panic.</span><span>
</span><span id="line-171"></span><span class="annot"><a href="GHC.Tc.Plugin.html#newGiven"><span class="hs-identifier hs-type">newGiven</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#CtLoc"><span class="hs-identifier hs-type">CtLoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier hs-type">PredType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvExpr"><span class="hs-identifier hs-type">EvExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.Constraint.html#CtEvidence"><span class="hs-identifier hs-type">CtEvidence</span></a></span><span>
</span><span id="line-172"></span><span id="newGiven"><span class="annot"><span class="annottext">newGiven :: CtLoc -&gt; Type -&gt; EvExpr -&gt; TcPluginM CtEvidence
</span><a href="GHC.Tc.Plugin.html#newGiven"><span class="hs-identifier hs-var hs-var">newGiven</span></a></span></span><span> </span><span id="local-6989586621681198704"><span class="annot"><span class="annottext">CtLoc
</span><a href="#local-6989586621681198704"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681198703"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681198703"><span class="hs-identifier hs-var">pty</span></a></span></span><span> </span><span id="local-6989586621681198702"><span class="annot"><span class="annottext">EvExpr
</span><a href="#local-6989586621681198702"><span class="hs-identifier hs-var">evtm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-173"></span><span>   </span><span id="local-6989586621681198701"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681198701"><span class="hs-identifier hs-var">new_ev</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; TcPluginM Id
</span><a href="GHC.Tc.Plugin.html#newEvVar"><span class="hs-identifier hs-var">newEvVar</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681198703"><span class="hs-identifier hs-var">pty</span></a></span><span>
</span><span id="line-174"></span><span>   </span><span class="annot"><span class="annottext">EvBind -&gt; TcPluginM ()
</span><a href="GHC.Tc.Plugin.html#setEvBind"><span class="hs-identifier hs-var">setEvBind</span></a></span><span> </span><span class="annot"><span class="annottext">(EvBind -&gt; TcPluginM ()) -&gt; EvBind -&gt; TcPluginM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; EvTerm -&gt; EvBind
</span><a href="GHC.Tc.Types.Evidence.html#mkGivenEvBind"><span class="hs-identifier hs-var">mkGivenEvBind</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681198701"><span class="hs-identifier hs-var">new_ev</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvExpr -&gt; EvTerm
</span><a href="GHC.Tc.Types.Evidence.html#EvExpr"><span class="hs-identifier hs-var">EvExpr</span></a></span><span> </span><span class="annot"><span class="annottext">EvExpr
</span><a href="#local-6989586621681198702"><span class="hs-identifier hs-var">evtm</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-175"></span><span>   </span><span class="annot"><span class="annottext">CtEvidence -&gt; TcPluginM CtEvidence
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CtGiven :: Type -&gt; Id -&gt; CtLoc -&gt; CtEvidence
</span><a href="GHC.Tc.Types.Constraint.html#CtGiven"><span class="hs-identifier hs-type">CtGiven</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ctev_pred :: Type
</span><a href="GHC.Tc.Types.Constraint.html#ctev_pred"><span class="hs-identifier hs-var">ctev_pred</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681198703"><span class="hs-identifier hs-var">pty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ctev_evar :: Id
</span><a href="GHC.Tc.Types.Constraint.html#ctev_evar"><span class="hs-identifier hs-var">ctev_evar</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681198701"><span class="hs-identifier hs-var">new_ev</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ctev_loc :: CtLoc
</span><a href="GHC.Tc.Types.Constraint.html#ctev_loc"><span class="hs-identifier hs-var">ctev_loc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CtLoc
</span><a href="#local-6989586621681198704"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span class="hs-comment">-- | Create a fresh evidence variable.</span><span>
</span><span id="line-178"></span><span class="annot"><a href="GHC.Tc.Plugin.html#newEvVar"><span class="hs-identifier hs-type">newEvVar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier hs-type">PredType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span>
</span><span id="line-179"></span><span id="newEvVar"><span class="annot"><span class="annottext">newEvVar :: Type -&gt; TcPluginM Id
</span><a href="GHC.Tc.Plugin.html#newEvVar"><span class="hs-identifier hs-var hs-var">newEvVar</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM Id -&gt; TcPluginM Id
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM Id -&gt; TcPluginM Id)
-&gt; (Type -&gt; TcM Id) -&gt; Type -&gt; TcPluginM Id
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; TcM Id
forall gbl lcl. Type -&gt; TcRnIf gbl lcl Id
</span><a href="GHC.Tc.Utils.TcMType.html#newEvVar"><span class="hs-identifier hs-var">TcM.newEvVar</span></a></span><span>
</span><span id="line-180"></span><span>
</span><span id="line-181"></span><span class="hs-comment">-- | Create a fresh coercion hole.</span><span>
</span><span id="line-182"></span><span class="annot"><a href="GHC.Tc.Plugin.html#newCoercionHole"><span class="hs-identifier hs-type">newCoercionHole</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier hs-type">PredType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CoercionHole"><span class="hs-identifier hs-type">CoercionHole</span></a></span><span>
</span><span id="line-183"></span><span id="newCoercionHole"><span class="annot"><span class="annottext">newCoercionHole :: Type -&gt; TcPluginM CoercionHole
</span><a href="GHC.Tc.Plugin.html#newCoercionHole"><span class="hs-identifier hs-var hs-var">newCoercionHole</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM CoercionHole -&gt; TcPluginM CoercionHole
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM CoercionHole -&gt; TcPluginM CoercionHole)
-&gt; (Type -&gt; TcM CoercionHole) -&gt; Type -&gt; TcPluginM CoercionHole
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">BlockSubstFlag -&gt; Type -&gt; TcM CoercionHole
</span><a href="GHC.Tc.Utils.TcMType.html#newCoercionHole"><span class="hs-identifier hs-var">TcM.newCoercionHole</span></a></span><span> </span><span class="annot"><span class="annottext">BlockSubstFlag
</span><a href="GHC.Core.TyCo.Rep.html#YesBlockSubst"><span class="hs-identifier hs-var">YesBlockSubst</span></a></span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span class="hs-comment">-- | Bind an evidence variable.  This must not be invoked from</span><span>
</span><span id="line-186"></span><span class="hs-comment">-- 'tcPluginInit' or 'tcPluginStop', or it will panic.</span><span>
</span><span id="line-187"></span><span class="annot"><a href="GHC.Tc.Plugin.html#setEvBind"><span class="hs-identifier hs-type">setEvBind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvBind"><span class="hs-identifier hs-type">EvBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPluginM"><span class="hs-identifier hs-type">TcPluginM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-188"></span><span id="setEvBind"><span class="annot"><span class="annottext">setEvBind :: EvBind -&gt; TcPluginM ()
</span><a href="GHC.Tc.Plugin.html#setEvBind"><span class="hs-identifier hs-var hs-var">setEvBind</span></a></span></span><span> </span><span id="local-6989586621681198694"><span class="annot"><span class="annottext">EvBind
</span><a href="#local-6989586621681198694"><span class="hs-identifier hs-var">ev_bind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-189"></span><span>    </span><span id="local-6989586621681198693"><span class="annot"><span class="annottext">EvBindsVar
</span><a href="#local-6989586621681198693"><span class="hs-identifier hs-var">tc_evbinds</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcPluginM EvBindsVar
</span><a href="GHC.Tc.Types.html#getEvBindsTcPluginM"><span class="hs-identifier hs-var">getEvBindsTcPluginM</span></a></span><span>
</span><span id="line-190"></span><span>    </span><span class="annot"><span class="annottext">TcM () -&gt; TcPluginM ()
forall a. TcM a -&gt; TcPluginM a
</span><a href="GHC.Tc.Types.html#unsafeTcPluginTcM"><span class="hs-identifier hs-var">unsafeTcPluginTcM</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM () -&gt; TcPluginM ()) -&gt; TcM () -&gt; TcPluginM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">EvBindsVar -&gt; EvBind -&gt; TcM ()
</span><a href="GHC.Tc.Utils.Monad.html#addTcEvBind"><span class="hs-identifier hs-var">TcM.addTcEvBind</span></a></span><span> </span><span class="annot"><span class="annottext">EvBindsVar
</span><a href="#local-6989586621681198693"><span class="hs-identifier hs-var">tc_evbinds</span></a></span><span> </span><span class="annot"><span class="annottext">EvBind
</span><a href="#local-6989586621681198694"><span class="hs-identifier hs-var">ev_bind</span></a></span><span>
</span><span id="line-191"></span></pre></body></html>